package com.ibangnuo.manage.dao;

import com.ibangnuo.framework.domain.CommercialTenant;
import com.ibangnuo.framework.domain.Merchants;
import com.ibangnuo.framework.domain.OrderTotal;
import com.ibangnuo.framework.domain.request.order.OrderQueryCountRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: wwy
 * @Date: 2020-01-02 15:56
 */
@Mapper
public interface OrderTotalMapper {

    List<Map> orderCount(@Param("list") List<Merchants> list);

    List<Map> agentCorderCount(@Param("list") List<CommercialTenant> list);

    List<Map> queryCount(OrderQueryCountRequest orderQueryGroupRequest);


    //代理商汇总
    Map consumeCount(String id); //订单总金额

    Map actualCount(String id); //实收总金额

    Map tuiCount(String id); //退款总金额

    Map discountsCount(String id);//折扣总金额

    //代理商的门店汇总查询
    List<Map> shopCount(@Param("list") List<Merchants> list);

    //员工下的商户的汇总
    List<OrderTotal> CountCommercial(String id);

    //商户按时间的汇总
    List<OrderTotal> CountCommercial1(Map map);

    //代理商按时间汇总
    Map consumeCount1(Map map);

    Map discountsCount1(Map map);

    Map tuiCount1(Map map);

    Map actualCount1(Map map);

    //员工微信汇总
    List<OrderTotal> CountCommercialWx(Map map);

    //员工的时间汇总
    Map eConsumeCountWx(Map map);

    Map eActualCountWx(Map map);

    Map eTuiCountWx(Map map);

    Map eDiscountsCountWx(Map map);

    //员工支付宝汇总按时间
    Map eConsumeCountAlipay(Map map);

    Map eActualCountAlipay(Map map);

    Map eTuiCountAlipay(Map map);

    Map eDiscountsCountAlipay(Map map);

    //代理商下的商户的微信汇总
    Map consumeCWx(Map map);

    Map discountsCWx(Map map);

    Map tuiCWx(Map map);

    Map actualCWx(Map map);

    //代理商下的商户的支付宝汇总
    Map consumeCAlipay(Map map);

    Map discountsCAlipay(Map map);

    Map tuiCAlipay(Map map);

    Map actualCAlipay(Map map);

    //代理商下的代理商的微信时间汇总
    Map discountsAWx(Map map);

    Map consumeAWx(Map map);

    Map actualAWx(Map map);

    Map tuiAWx(Map map);

    //代理商下的代理商的支付宝时间汇总
    Map discountsAAlipay(Map map);

    Map consumeAAlipay(Map map);

    Map actualAAlipay(Map map);

    Map tuiAAlipay(Map map);

    //登录者是代理商的日汇总
    List<Map> findByAgentId(Map map);

    //登录者是商户的日汇总
    List<Map> findByCommercialId(Map<String, String> map);

    //登录者是代理商的商户的日汇总
    List<Map> findByCId(Map map);

    //代理商下级代理的日汇总
    List<Map> findSecondByAgent(Map map);

    //商户的微信月汇总
    Map tConsumeCountWx(Map map);//该商户的订单总金额和条数

    Map tActualCountWx(Map map);//实收总金额 和条数

    Map tTuiCountWx(Map map);//退款总金额 和条数

    Map tDiscountsCountWx(Map map);//折扣总金额

    //商户的支付宝月汇总
    Map tConsumeCountAlipay(Map map);//该门店的订单总金额和条数

    Map tActualCountAlipay(Map map);//实收总金额 和条数

    Map tTuiCountAlipay(Map map);//退款总金额 和条数

    Map tDiscountsCountAlipay(Map map);//折扣总金额

    //代理商微信的月汇总
    Map aConsumeCountWx(Map map);//该商户的订单总金额和条数

    Map aActualCountWx(Map map);//实收总金额 和条数

    Map aTuiCountWx(Map map);//退款总金额 和条数

    Map aDiscountsCountWx(Map map);//折扣总金额

    //代理商的支付宝月汇总
    Map aConsumeCountAlipay(Map map);//该门店的订单总金额和条数


    Map aActualCountAlipay(Map map);//实收总金额 和条数

    Map aTuiCountAlipay(Map map);//退款总金额 和条数

    Map aDiscountsCountAlipay(Map map);//折扣总金额


    Map findMonthByAgentId(Map<String, String> map);

    Map findMonthByCommercialId(Map<String, String> map);

    Map findMonthByCId(Map<String, String> map);

    Map findMonthByAId(Map<String, String> map);

    Map findAlipayByAId(Map<String, String> map);

    Map findWxByAId(Map<String, String> map);

    Map findAlipayByCId(Map map);

    Map findWxByCId(Map map);

    Map findDateAlipayByAId(Map map);

    Map findDateWxByAId(Map map);

    Map findDateAlipayByCId(Map map);

    Map findDateWxByCId(Map map);

    List<Map> findDateAlipayByAgentId(Map map);

    List<Map> findDateWxByAgentId(Map map);

    List<Map> findDateAlipayByCommercialId(Map map);

    List<Map> findDateWxByCommercialId(Map map);

    Map findSettleAccounts(Map<String, String> m);
}
